package com.xiaoniu.mc.client.config;

import com.xiaoniu.mc.client.constant.SystemConstant;
import com.xiaoniu.mc.client.enums.ProducerStrategy;
import org.apache.rocketmq.client.producer.SendCallback;

/**
 * @类描述：
 * @创建人：林继丰
 * @创建时间：2017/8/25 18:07
 * @版权：Copyright (c) 深圳市牛鼎丰科技有限公司-版权所有.
 */
public class ProducerConfig {

    private String topic;

    private String tags;

    private String keys;

    private String orderId;

    private SendCallback sendCallback;

    private ProducerStrategy producerStrategy;

    private boolean orderly = false;

    private String chartSet = SystemConstant.CHART_SET_UTF8;

    private ProducerConfig setConfigTopic(String topic) {
        setTopic(topic);
        return this;
    }

    private ProducerConfig setConfigTags(String tag) {
        setTags(tag);
        return this;
    }

    private ProducerConfig setConfigKeys(String keys) {
        setKeys(keys);
        return this;
    }

    private ProducerConfig setConfigOrderId(String orderId) {
        setOrderId(orderId);
        return this;
    }

    private ProducerConfig setConfigSendCallBack(SendCallback sendCallBack) {
        setSendCallback(sendCallBack);
        return this;
    }

    private ProducerConfig setConfigStrategy(ProducerStrategy strategy) {
        setProducerStrategy(strategy);
        return this;
    }

    private ProducerConfig setConfigOrderly(boolean orderly) {
        setOrderly(orderly);
        return this;
    }

    private ProducerConfig setConfigChartSet(String chartSet) {
        setChartSet(chartSet);
        return this;
    }

    public String getChartSet() {
        return chartSet;
    }

    public void setChartSet(String chartSet) {
        this.chartSet = chartSet;
    }

    public boolean isOrderly() {
        return orderly;
    }

    public void setOrderly(boolean orderly) {
        this.orderly = orderly;
    }

    public ProducerStrategy getProducerStrategy() {
        return producerStrategy;
    }

    public void setProducerStrategy(ProducerStrategy producerStrategy) {
        this.producerStrategy = producerStrategy;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public String getTags() {
        return tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }

    public String getKeys() {
        return keys;
    }

    public void setKeys(String keys) {
        this.keys = keys;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public SendCallback getSendCallback() {
        return sendCallback;
    }

    public void setSendCallback(SendCallback sendCallback) {
        this.sendCallback = sendCallback;
    }
}
